API Integration Assistant
The API Integration Assistant uses natural language, cURL messages, JSON parameters, or API documentation to automatically identify HTTP API integration information, generate configuration plans for request parameters, headers, body, response mapping, etc. Its core purpose is to quickly complete third‑party system integration with MES, ERP, cloud platforms, etc.
Features
- Supports direct input of API integration requirements, cURL messages, JSON Request Body, API request parameter descriptions, or uploading API documentation attachments.
- Supports uploading multiple attachments, each up to 10MB, in formats such as doc, docx, pdf, txt, png, jpeg, webp.
- Automatically determines whether the input is a single API or multiple APIs, and extracts configuration items such as endpoint addresses, request methods, Base URL, global Headers, Params, Body, etc.
- Generates a Response → CMS tag mapping table from response examples, reducing repetitive manual field mapping.
- When critical missing items are detected (authentication method, headers, required parameters, response mapping, etc.), the AI proactively asks the user to complete the information.
- Displays the API configuration plan in standard Markdown. After user confirmation, the AI can call the CMS “Add API Connection” interface to persist the configuration and refresh the page to show the new entry.
Core Advantages
1. Lower the Barrier to API Integration
OT engineers no longer need to study HTTP request structure, authentication methods, and response parsing rules. They only need to provide API information or describe integration goals; the AI generates a configurable, testable, and writable API configuration plan.
Traditional Approach vs. AI Approach:
Traditional approach:
Read API documentation → manually decompose URL, Headers, parameters → configure request body → configure response mapping → manual debugging → repeated troubleshooting
Requires: API experience + document comprehension + multiple rounds of manual configuration
AI approach:
Enter requirements or upload documentation → AI parses configuration → supplement missing items → review configuration plan → confirm and write
Requires: clearly stating business goals and data mapping relationships
2. Reduce Configuration Errors and Debugging Time
- API recognition: automatically identifies single/multiple APIs, Base URL, and request methods.
- Parameter extraction: automatically organizes Headers, Params, Body, authentication information, etc.
- Response mapping: generates field‑to‑CMS tag mapping suggestions from response examples.
- Missing item prompting: proactively asks for missing critical configuration items.
3. Accelerate Third‑Party System Integration
In integration scenarios with MES, ERP, WMS, cloud platforms, alarm platforms, etc., API configuration often involves many repetitive fields and formatting rules. The API Integration Assistant consolidates the process of “parsing API documentation, configuring parameters, debugging requests, mapping fields” into a single conversation, significantly shortening project implementation cycles.
Typical Scenarios
Scenario 1: MES Work Order Query API Integration
Background: After equipment scanning, the system needs to query work order information through the MES API and write fields such as product model and target quantity into CMS tags.
Requirement description:
Please help me configure an MES work order query API.
API information:
- Base URL: http://mes.company.com
- Path: /api/workorder/query
- Request method: POST
- Headers: Content-Type=application/json, Authorization=Bearer {{MESToken}}
- Request Body:
{
"workOrderId": "{{WorkOrderID}}"
}
Response example:
{
"code": 0,
"data": {
"productModel": "A100",
"targetQty": 500,
"planStartTime": "2026-06-01 08:00:00"
}
}
Mapping:
- data.productModel -> CMS tag ProductModel
- data.targetQty -> CMS tag TargetQuantity
- data.planStartTime -> CMS tag PlanStartTime
AI‑generated configuration plan:
API name: MES Work Order Query
Request method: POST
Base URL: http://mes.company.com
Path: /api/workorder/query
Headers:
- Content-Type: application/json
- Authorization: Bearer {{MESToken}}
Body:
- workOrderId: bound to CMS tag WorkOrderID
Response mapping:
- $.data.productModel -> ProductModel
- $.data.targetQty -> TargetQuantity
- $.data.planStartTime -> PlanStartTime
Pre‑check result:
- Request structure validation passed
- Headers configuration complete
- Response field parsing passed
Value:
- No need to manually decompose API documentation.
- Automatically generates request body and response field mappings.
- Pre‑check before writing reduces on‑site troubleshooting costs.
Scenario 2: ERP Multi‑API Order Synchronisation
Background: The production line needs to retrieve pending production orders from ERP and write back production results after completion.
API information:
ERP common base URL: http://erp.company.com/openapi
API 1: Get pending orders
- Path: /orders/pending
- Method: GET
- Headers: X-App-Key={{ERPAppKey}}, X-Sign={{ERPSign}}
- Query: lineCode={{LineCode}}
API 2: Write back completion result
- Path: /orders/complete
- Method: POST
- Headers: X-App-Key={{ERPAppKey}}, X-Sign={{ERPSign}}
- Body:
{
"orderNo": "{{CurrentOrderNo}}",
"completeQty": "{{CompleteQty}}",
"finishTime": "{{FinishTime}}"
}
AI parsing result:
Detected multiple APIs.
Common configuration:
- Base URL: http://erp.company.com/openapi
- Global Headers:
- X-App-Key: {{ERPAppKey}}
- X-Sign: {{ERPSign}}
API 1: Get pending orders
- Method: GET
- Path: /orders/pending
- Params: lineCode={{LineCode}}
- Suggested mapping: order number, product code, planned quantity, due date
API 2: Write back completion result
- Method: POST
- Path: /orders/complete
- Body: orderNo, completeQty, finishTime
- Suggested validation: completeQty must be numeric, finishTime uses datetime format
Value:
- Automatically extracts shared Base URL and global Headers.
- Avoids repeated configuration of authentication information.
- Centralizes management of order retrieval and result write‑back APIs.
Scenario 3: API Debugging Failure Troubleshooting
Background: A configured API fails with a 401 error or empty field parsing.
Ask the AI:
This API pre‑check failed. Please help me troubleshoot.
Failure info:
- HTTP status code: 401
- Response: {"message":"Unauthorized"}
Current configuration:
- URL: http://cloud.company.com/api/device/status
- Method: GET
- Headers: Content-Type=application/json
- Params: deviceId={{DeviceID}}
AI troubleshooting suggestions:、
Diagnosis:
The failure is most likely due to missing authentication Headers.
Suggested actions:
1. Confirm whether the API requires Authorization, X-Token, AppKey, or signature fields.
2. If using Bearer Token, add:
Authorization: Bearer {{CloudToken}}
3. If the token has an expiry, verify that the CloudToken tag has been updated.
4. After adding, rerun the pre‑check debug.
Questions to confirm:
- What authentication method does this cloud platform API use?
- Is the token a fixed value, or does it need to be obtained dynamically from another API?
Value:
- Quickly identifies common issues such as missing headers, authentication failures, and incorrect field paths.
- Completes missing items through conversation.
- Reduces on‑site trial and error.
5‑Minute Quick Start
Step 1: Open the API Integration Assistant
In the API Connections or interface configuration page, click the AI assistant entry to open the “API Integration Assistant”.

Step 2: Enter or Upload API Information
You can use any of the following methods:
- Directly describe the integration requirements.
- Paste a cURL message.
- Paste a JSON Request Body or response example.
- Enter API request parameter descriptions.
- Upload an API documentation attachment.

Step 3: Wait for AI Parsing
The AI identifies the number of APIs, endpoints, request methods, Headers, Params, Body, response fields, etc., and generates a structured configuration plan.
Step 4: Complete Missing Items
If the AI detects missing critical information (authentication method, required parameters, tag mapping, response example, etc.), it proactively asks questions. After the user provides the missing information, the AI continues to refine the plan.
Step 5: Write Configuration with One Click
After confirming the plan is correct, the AI calls the CMS “Add API Connection” interface to persist the configuration. On success, the page refreshes and displays the newly added API configuration.
Prompting Tips (For Accurately Generating API Configuration)
Tip 1: Provide Complete cURL First
cURL usually contains the URL, request method, headers, and body, allowing the AI to parse most of the configuration directly.
Example:
curl -X POST "http://mes.company.com/api/workorder/query" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer {{MESToken}}" \
-d '{"workOrderId":"{{WorkOrderID}}"}'
Tip 2: Clarify API Inputs and CMS Tag Sources
Explain which parameters come from fixed values and which come from CMS tags.
Example:
API parameter description:
- lineCode is fixed to L2
- workOrderId comes from CMS tag WorkOrderID
- token comes from CMS tag MESToken
- requestTime uses the current time in format yyyy-MM-dd HH:mm:ss
Tip 3: Provide Response Example and Mapping Targets
Without a response example, the AI cannot accurately generate Response → CMS tag mapping. Provide at least one successful response example.
Example:
Response example:
{
"success": true,
"data": {
"temperature": 78.5,
"pressure": 1.6,
"status": "RUNNING"
}
}
Mapping targets:
- data.temperature -> DeviceTemperature
- data.pressure -> DevicePressure
- data.status -> DeviceStatus
Tip 4: Specify Common Configuration for Multiple APIs
When multiple APIs belong to the same system, describe the shared Base URL, global Headers, and authentication method in one go.
Example:
The following APIs all belong to the ERP system:
- Base URL: http://erp.company.com/openapi
- Global Headers: X-App-Key={{ERPAppKey}}, X-Sign={{ERPSign}}
- Request timeout: 10 seconds
APIs include:
1. GET /orders/pending: get pending orders
2. POST /orders/complete: write back completion result
3. POST /orders/alarm: report alarm information
Prompt Template Library
Template 1: Single API Configuration
Please help me generate an API configuration.
API information:
- API name: [API name]
- Base URL: [system address]
- Path: [API path]
- Request method: [GET/POST/PUT/DELETE]
- Authentication: [Bearer Token/AppKey/Signature/None]
- Headers: [list of Headers]
- Params: [list of Query parameters]
- Body: [request body JSON]
Tag sources:
- [parameter name] comes from CMS tag [tag name]
Response example:
[paste JSON response]
Response mapping:
- [response field path] -> [CMS tag name]
Please generate the configuration plan and run a pre‑check debug, then write the configuration after confirmation.
Template 2: API Documentation Parsing
I have uploaded an API documentation file. Please parse the API configuration from it.
Focus on:
1. API endpoints, request methods, Base URL
2. Headers, Params, Body
3. Authentication method
4. Successful response example
5. Fields that can be mapped to CMS tags
Requirements:
- If required parameters are missing in the documentation, ask me first.
- If there are multiple APIs, present them grouped by API.
- Show the Markdown configuration plan first, do not write directly.
Template 3: Multiple API Configuration
Please help me configure a set of third‑party system APIs.
Common information:
- System name: [MES/ERP/WMS/Cloud platform]
- Base URL: [common address]
- Global headers: [common Headers]
- Authentication: [authentication description]
API list:
1. [API 1 name]
- Method: [GET/POST/PUT/DELETE]
- Path: [path]
- Parameters: [parameter description]
- Response mapping: [field path -> CMS tag]
2. [API 2 name]
- Method: [GET/POST/PUT/DELETE]
- Path: [path]
- Parameters: [parameter description]
- Response mapping: [field path -> CMS tag]
Please automatically extract reusable configuration and generate a configuration plan for each API.
Template 4: Response Mapping Generation
Please generate a Response → CMS tag mapping table from the following response example.
Response example:
[paste JSON]
Business meaning:
- [field explanation]
Target tags:
- [list of CMS tags]
Requirements:
- Map only the fields needed for business.
- Keep numeric fields as numeric.
- Handle time fields in format yyyy-MM-dd HH:mm:ss.
- List uncertain mappings as “to be confirmed”.
Frequently Asked Questions
Q1: Can AI‑generated API configuration be used directly in production?
A: Not recommended. The correct workflow:
- AI generates an initial configuration plan.
- Verify the URL, authentication method, Headers, parameters, and response mapping.
- After thorough testing, write the configuration to production.
Q2: What input methods and attachment formats are supported?
A: Natural language descriptions, cURL messages, JSON parameters, API request parameter descriptions, and API documentation attachments.
Q3: What if the API information is incomplete?
A: The AI identifies missing critical items and asks proactively. Common missing items include:
- Authentication method or Token source
- Required Headers
- Query or body parameter sources
- Successful response example
- Response field to CMS tag mapping
For non‑critical mappings that cannot be determined, you can leave them blank and supplement later.
Q4: Does it support configuring multiple APIs together?
A: Yes. The AI recognises multiple APIs and automatically extracts reusable Base URLs and global Headers. It is recommended to provide a set of APIs for the same system together, e.g., “get orders, write back result, report alarm”.
Q5: What is the difference between the API Integration Assistant and the AI Script Assistant?
A: The API Integration Assistant is mainly for generating and writing API connection configurations – suitable for standard HTTP API request parameters, Headers, Body, response mapping, and pre‑check debugging. The AI Script Assistant is mainly for generating C# scripts – suitable for complex business logic, conditionals, data processing, batch operations, and custom workflows.
Simple guideline:
- Standard API configuration, response mapping, pre‑check debugging: use the API Integration Assistant.
- After the API call, if you need complex calculations, loops, exception branches, or multi‑system orchestration: use the AI Script Assistant.
Best Practices
1. Provide Real Response Examples
The more realistic the response example, the more accurate the field mapping. Provide both successful and typical failure responses so the AI can generate both normal parsing and error‑handling suggestions.
2. Specify Authentication Source
Do not just say “needs a token”. Explain whether the token is a fixed value, a CMS tag, or obtained from another API. For sensitive information, use tag placeholders instead of pasting real secrets.
Recommended:
Authorization: Bearer {{MESToken}}
MESToken comes from a CMS tag, maintained regularly by operations.
3. Start with Core APIs, Then Expand
When integrating a new system for the first time, start with the most critical and simplest API. After confirming authentication, network connectivity, and field mapping are stable, extend to multiple APIs.
4. Map Only Necessary Fields
Do not map every field in the response to a CMS tag. Only map fields actually needed for page display, business logic, alarms, or archiving. This reduces maintenance costs.
5. Carefully Review Pre‑Check Results Before Writing
Verify the following before writing the configuration:
- Is the request method correct?
- Is the Base URL + Path correctly concatenated?
- Are Headers and authentication complete?
- Are Body parameters sourced from the correct tags?
- Can the response field paths be resolved to values?
- Do the debug results meet expectations?
6. Build an API Configuration Template Library
Capture common systems’ Base URLs, authentication methods, global Headers, response formats, and field mapping rules as team templates. Future projects can reuse them, reducing repetitive descriptions and trial‑and‑error.
Next Steps
- AI Tag Assistant – When API responses need to be written to CMS tags, first learn tag creation and point table import to prepare a clear tag foundation.
- AI Script Assistant – When API configuration alone is insufficient and complex business logic, data processing, or multi‑system orchestration is needed, continue learning script development.
- AI Smart Binding – After API data enters CMS, learn how to bind tags or data tables to page components.
- Usage Tips & Best Practices – Systematically study API prompt writing, cross‑assistant collaboration workflows, and team reuse standards.